In an electrical machine, for example a linear motor or a torque motor, where the electrical machine has a primary part or a secondary part, it is necessary to use an encoder or a corresponding sensor in order to determine the position of the primary part with respect to the secondary part. The electrical machine is, for example, a permanently excited synchronous machine, with the result that the secondary part of the electrical machine has permanent magnets. The primary part is, for example, the stator of a rotary electrical machine and the secondary part is, for example, the armature of the electrical machine. In a linear motor, the primary part is, for example, the moving part and the secondary part, which has permanent magnets, is the stationary part.
For operation of, for example, permanently excited synchronous machines on a converter, it is necessary to know the absolute position of the secondary part. In rotary machines, the absolute position is the rotor position, with the rotor being the armature and the rotor position thus being the armature position. An absolute encoder is generally required in order to determine the rotor position. This absolute encoder is a technically complex means for determining the rotor position. A relative encoder is then sufficient and also customarily used for operation of a permanently excited synchronous machine. To date, the absolute rotor position has been detected by means of separate sensors. The sensors are arranged outside a main magnetic circuit of the electrical machine, with the result that it is not possible for such a sensor to also detect the main magnetic circuit. By way of example, a Hall sensor in a separate box outside a housing of a primary part of the linear motor is required in a linear motor. The separate box serves to evaluate the stray flux of permanent magnets of a secondary part of the linear motor. In rotary machines, for example a torque motor, it is not possible, for design reasons, to use a separate box of this type which has a Hall sensor. In a torque motor, it is only possible to detect the rotor position by means of a dedicated sensor track of a sensor which is fitted to the torque motor.